<template>
	<view>
		<view class="standing-card">
			<view class="show-flg">
				<view class="show-list" v-if="index<3" v-for="(item,index) in data" :key="index">
					<view class="top-icon">
						<image v-if="index === 1" src="https://lt.caomei.zone/xcxstatic/static/renmai/金@2x.png" mode=""></image>
						<image v-else-if="index === 2" src="https://lt.caomei.zone/xcxstatic/static/renmai/银@2x.png" mode=""></image>
						<image v-else src="https://lt.caomei.zone/xcxstatic/static/renmai/铜@2x.png" mode=""></image>
					</view>
					<view class="top-img">
						<image v-if="index === 1" :src="item.headimg" mode=""></image>
						<image v-else-if="index === 2" :src="item.headimg" mode=""></image>
						<image v-else :src="item.headimg" mode=""></image>
					</view>
					<view class="name">
						<text v-if="index === 1">{{item.nickname}}</text>
						<text v-else-if="index === 2">{{item.nickname}}</text>
						<text v-else>{{item.nickname}}</text>
					</view>
					<view class="num colorTheme">
						<text v-if="index === 1">邀请人数:{{item.count}}</text>
						<text v-else-if="index === 2">邀请人数:{{item.count}}</text>
						<text v-else>邀请人数:{{item.count}}</text>
					</view>
				</view>
			</view>
			<view class="data-list" v-for="(item,index) in data">
				<view class="show-no" v-if="index>2">
					<view class="list-card">
						<view class="left">
							<view class="index">
								{{index}}
							</view>
							<view class="topImg">
								<image :src="item.headimg" mode=""></image>
							</view>
							<view class="name">
								<text>{{item.nickname}}</text>
							</view>
						</view>
						<view class="right colorTheme">
							<view class="" style="display: flex;align-items: center;">
								<uni-icons type="contact" size="26"></uni-icons>
								<text>邀请人数:{{item.count}}</text>
							</view>
							<view class="num">
								22+{{index*index*10}}
							</view>
						</view>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	var app = getApp();
	export default {
		data() {
			return {
				data: [],
			};
		},
		onLoad() {
			const that = this; // 保存当前组件
			app.get('ApiIndex/thecharts', {}, function(res) {
				that.data = res.data; // 使用保存的引用来设置 data
				console.log(that.data, '积分')
			});

		},
		mounted() {
			console.log(this.data, 'jifen')
		}

	}
</script>

<style lang="less">
	page {
		background-color: #FFFFFF;
	}

	.show-flg {
		// background-color: #FF4F4F;
		height: 25vh;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx 30rpx;

		.show-list {
			height: 280rpx;
			width: 26%;
			// background-color: #008000;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;

			.top-icon {
				height: 50rpx;
				width: 50rpx;
				// background-color: #ff0000;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.top-img {
				width: 150rpx;
				height: 145rpx;
				// background-color: #0301BC;
				border-radius: 50%;

				image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}

			.num {
				font-size: 26rpx;
			}
		}

		.show-list:first-child {
			height: 315rpx;
			width: 30%;
			// background-color: #007AFF;
			position: absolute;
			left: 50%;
			transform: translateX(-50%);

			.top-img {
				width: 190rpx;
				height: 180rpx;
				background-color: #0301BC;
				border-radius: 100%;
			}
		}
	}

	.show-no {
		width: 100%;
		padding-left: 10rpx;
		background-color: #FFFFFF;

		.list-card {
			width: 100%;
			padding: 25rpx 10rpx;
			border-bottom: 1rpx solid #d3d3d3;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.left {
				display: flex;
				align-items: center;

				.index {
					font-size: 36rpx;
				}

				.name {
					font-size: 36rpx;
				}

				.topImg {
					width: 80rpx;
					height: 80rpx;
					border-radius: 100%;
					background-color: #007AFF;
					margin: 0 15rpx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}
			}

			.right {
				display: flex;
				align-items: center;
				font-size: 26rpx;
				justify-content: flex-start;
				min-width: 32%;

			}
		}
	}
</style>